<html>
<head><meta charset="utf-8"><title>LLVM IR:tag debuginfo lexical Scopes with &quot;unsafe&quot; attribute · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/LLVM.20IR.3Atag.20debuginfo.20lexical.20Scopes.20with.20.22unsafe.22.20attribute.html">LLVM IR:tag debuginfo lexical Scopes with &quot;unsafe&quot; attribute</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="225301403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/LLVM%20IR%3Atag%20debuginfo%20lexical%20Scopes%20with%20%22unsafe%22%20attribute/near/225301403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Siddharth Priya <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/LLVM.20IR.3Atag.20debuginfo.20lexical.20Scopes.20with.20.22unsafe.22.20attribute.html#225301403">(Feb 05 2021 at 14:02)</a>:</h4>
<p>TL;DR next step for geting rustc to output lexical scope "unsafe" attribute?</p>
<p>Hello,</p>
<p>Background: <a href="https://internals.rust-lang.org/t/annotate-unsafe-code-in-llvm-ir/13971">https://internals.rust-lang.org/t/annotate-unsafe-code-in-llvm-ir/13971</a></p>
<p>Setting <code>DW_AT_name</code> to "unsafe" for lexical scopes which arise from unsafe code blocks/functions is one solution for mapping IR back to unsafe code blocks. I want to understand if some team/person needs to approve before code is written? -- thanks</p>



<a name="225303062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/LLVM%20IR%3Atag%20debuginfo%20lexical%20Scopes%20with%20%22unsafe%22%20attribute/near/225303062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/LLVM.20IR.3Atag.20debuginfo.20lexical.20Scopes.20with.20.22unsafe.22.20attribute.html#225303062">(Feb 05 2021 at 14:15)</a>:</h4>
<p>Doesn't sound like large enough change to need prior approval, primarily because debug info output is not really covered by stability guarantees. But if you'd like a discussion to happen first anyway, you should file a major change proposal issue.</p>



<a name="225319054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/LLVM%20IR%3Atag%20debuginfo%20lexical%20Scopes%20with%20%22unsafe%22%20attribute/near/225319054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/LLVM.20IR.3Atag.20debuginfo.20lexical.20Scopes.20with.20.22unsafe.22.20attribute.html#225319054">(Feb 05 2021 at 16:12)</a>:</h4>
<p>I would be quite interested to see how the named blocks are represented by debuggers and what the improvements would be anticipated by this change.</p>



<a name="225319073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/LLVM%20IR%3Atag%20debuginfo%20lexical%20Scopes%20with%20%22unsafe%22%20attribute/near/225319073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/LLVM.20IR.3Atag.20debuginfo.20lexical.20Scopes.20with.20.22unsafe.22.20attribute.html#225319073">(Feb 05 2021 at 16:12)</a>:</h4>
<p>but to answer that I suspect you basically need to have the implementation already?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>